package com.bwie.xujiahaonewstitle.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.bwie.xujiahaonewstitle.fragment.Fragment1_frag;

import java.util.List;

/**
 * 项目名称
 * 类描述：
 * 创建人：${徐家浩}
 * 创建时间：2017/2/17 20:11
 * 修改人：${徐家浩}
 * 修改备注：
 */
public class MyFragmentstatePageAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> list;
    private List<String> strings;
    private List<String> strings2;
    public MyFragmentstatePageAdapter(FragmentManager fm, List<Fragment> list, List<String> strings2, List<String> strings) {
        super(fm);
        this.list = list;
        this.strings2 = strings2;
        this.strings = strings;
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return strings.get(position);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment1_frag fragment = (Fragment1_frag) list.get(position);
        Bundle bundle = new Bundle();
        bundle.putString("key", strings2.get(position));
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public int getCount() {
        return 15;
    }
}
